package com.deram.ctin.serv.business.impl;

import com.deram.ctin.common.bean.PageResult;
import com.deram.ctin.serv.business.api.BusinessTenderApi;
import com.deram.ctin.serv.business.entity.BaseUpdateInfo;
import com.deram.ctin.serv.business.entity.BusinessTender;
import com.deram.ctin.serv.business.filter.BusinessTenderFilter;
import com.deram.ctin.serv.business.service.BusinessTenderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: jtt
 * @Description:
 * @Date: 2017/9/13 16:01
 * @version: V1.0
 */
@RestController
public class BusinessTenderApiImpl implements BusinessTenderApi {

    @Autowired
    BusinessTenderService businessTenderService;

    @Override
    public List<BusinessTender> list(@RequestBody BusinessTenderFilter filter) {
        return businessTenderService.list(filter);
    }

    @Override
    public BusinessTender save(@RequestBody BusinessTender param) {
        return businessTenderService.save(param);
    }

    @Override
    public void delete(Long id) {
        businessTenderService.delete(id);
    }

    @Override
    public void saveList(@RequestBody BaseUpdateInfo<BusinessTender> updateInfo) {
        businessTenderService.saveList(updateInfo);
    }

    @Override
    public PageResult<BusinessTender> search(@RequestBody BusinessTenderFilter filter, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) {
        return businessTenderService.search(filter, pageNo, pageSize);
    }
}
